--#include "data\functions\Activity\DailyActivity\SceneAnswer.lua"   once         		--每日活动答题
--#include "data\functions\Activity\DailyActivity\PersonAnswer.lua"   once         		--每日单人答题

local npcId = 171
NpcDialog[npcId] = {}
local t = NpcDialog[npcId]


t.main = function(sysarg)
	local functions = {}
	functions[1] = { Lang.ScriptTips.ButtonEnter, "EnterSceneAnswer" }
	functions[2] = { Lang.ScriptTips.ButtonAnswer, "StartPersonAnswer" }
	functions[3] = { Lang.ScriptTips.ButtonRank, "GetAnswerRank" }


	local strCond = ""
	if InSceneAnswerDoing() then
		strCond = string.format( Lang.ScriptTips.OpenStatusFormat, Lang.ScriptTips.Color_Greed, Lang.ScriptTips.COM0095 )
	else
		strCond = string.format( Lang.ScriptTips.OpenStatusFormat, Lang.ScriptTips.Color_Red, Lang.ScriptTips.COM0096 )
	end

	--额外条件（或显示）
	extConds 	= {}
	extConds[1] = strCond
	CommonNpcDialog( sysarg, PersonAnswerConfig, enDailyOpTimes_PersonAnswer, 0, Lang.ScriptTips.PersonAnswerDesc, functions, NpcDialogType.AnswerDlg, 
		extConds)
end

--进入答题场景
t.EnterSceneAnswer = function(sysarg)
	EnterAnswerScene( sysarg )
end

--开启个人答题
t.StartPersonAnswer = function(sysarg)
	PersonAnswerStart( sysarg )
	Actor.closeNPCDialog(sysarg)
end

--请求排行榜
t.GetAnswerRank = function ( sysarg )
	SendCommonRankSimpleData( sysarg, enCommonRankType_AnswerToday )
end
